package com.ptswitch.material.service;

import java.util.Collection;
import java.util.List;

import org.hxzon.project.ModelService;

import com.ptswitch.material.model.material.Material;

public interface MaterialService {
    public static final int Init_BomMaterials = 1 << 1;
    public static final int Init_Uploads = 1 << 2;
    public static final int Init_ContractItems = 1 << 3;

    public void saveAll(Collection<Material> newMaterials, Collection<Material> oldMaterials, Collection<Material> updateMaterials);

    public Material findById(String id, int init);

    public Material findByCode(String code);

    public List<Material> findByPcbDecal(String pcbDecal);

    public boolean existPcbDecal(String pcbDecal);

    public String emptyCode(String code);

    public Material findById(String id);

    public List<Material> findLike(String like, long first, long size);

    public long countLike(String like);

    public void deleteAll();

    public void save(Material material);

    public void delete(Material material);

    public List<Material> findAll();

    public void saveAll(List<Material> materials);

    public void deleteAll(List<Material> materials);

    public List<Material> findLikeByExample(Material material, long first, long size);

    public long countLikeByExample(Material material);

    public List<Material> findAll(long first, long size);

    public long countAll();

}
